<template>
  <div>
    <div class="header">
      <span class="s1">日期</span>
      <span class="s2">姓名</span>
      <span class="s3">地址</span>
    </div>
    <vue-seamless-scroll :data="listData" class="warp">
      <el-table :show-header="false" :data="listData" style="width: 100%">
        <el-table-column prop="date" width="120"> </el-table-column>
        <el-table-column prop="name" width="180"> </el-table-column>
        <el-table-column prop="city"> </el-table-column>
      </el-table>
    </vue-seamless-scroll>
  </div>
</template>

<script>
import vueSeamlessScroll from 'vue-seamless-scroll'

export default {
  name: 'Example01Basic',
  components: {
    vueSeamlessScroll
  },
  data() {
    return {
      listData: []
    }
  },
  methods: {
    async getTable() {
      const { data: res } = await this.$http.get('/getMockPersonal')
      this.listData = res.data
      console.log(res)
    }
  },
  created() {
    this.getTable()
  }
}
</script>

<style lang="scss" scoped>
.warp {
  height: 440px;
  width: 90%;
  margin: 0 auto;
  overflow: hidden;
  ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    li,
    a {
      display: block;
      height: 30px;
      line-height: 30px;
      display: flex;
      justify-content: space-between;
      font-size: 15px;
    }
  }
}
.header {
  display: flex;
  height: 50px;
  align-items: center;
  .s1 {
    margin-left: 70px;
  }
  .s2 {
    margin-left: 70px;
  }
  .s3 {
    margin-left: 210px;
  }
}
</style>
